package com.changhongit.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.changhongit.dao.ServiceUserDao;
import com.changhongit.entity.ServiceUser;
import com.changhongit.service.ServiceUserService;
import com.changhongit.util.PageView;

@Transactional
@Service("serviceUserService")
public class ServiceUserServiceImpl implements ServiceUserService {
	@Autowired
	private ServiceUserDao serviceUserDao;

	public PageView query(PageView pageView, ServiceUser serviceUser) {
		List<ServiceUser> list = serviceUserDao.query(pageView, serviceUser);
		pageView.setRecords(list);
		return pageView;
	}

	public void add(ServiceUser serviceUser) {
		serviceUserDao.add(serviceUser);

	}

	public void delete(String id) {
		serviceUserDao.delete(id);

	}

	public ServiceUser getById(String id) {
		return serviceUserDao.getById(id);
	}

	public void modify(ServiceUser serviceUser) {
		serviceUserDao.modify(serviceUser);
	}

	@Override
	public List<ServiceUser> findAll(String spId) {
		return serviceUserDao.findAll(spId);
	}

	@Override
	public void updateServiceUserStatus(ServiceUser serviceUser) {
		serviceUserDao.updateServiceUserStatus(serviceUser);
	}

}
